﻿namespace HelenServer.Data.SqlServer;

public interface IWriter
{
    Task<int> RemoveAsync<TEntity>(TEntity entity, CancellationToken cancellationToken = default)
        where TEntity : class, new();

    Task<int> RemoveRangeAsync<TEntity>(IEnumerable<TEntity> entities, CancellationToken cancellationToken = default)
        where TEntity : class, new();

    Task<int> AddAsync<TEntity>(TEntity entity, CancellationToken cancellationToken = default)
        where TEntity : class, new();

    Task<int> AddIdentityAsync<TEntity>(TEntity entity, CancellationToken cancellationToken = default)
        where TEntity : class, new();

    Task<int> AddRangeAsync<TEntity>(IEnumerable<TEntity> entities, CancellationToken cancellationToken = default)
        where TEntity : class, new();

    Task<int> AddIdentityRangeAsync<TEntity>(IEnumerable<TEntity> entities, CancellationToken cancellationToken = default)
        where TEntity : class, new();

    Task<int> UpdateAsync<TEntity>(TEntity entity, CancellationToken cancellationToken = default)
        where TEntity : class, new();

    Task<int> UpdateAsync<TEntity>(TEntity entity, Expression<Func<TEntity, object>>[] updatingExpressions, CancellationToken cancellationToken = default)
        where TEntity : class, new();
}